package com.car.loan.project.xr.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.car.loan.framework.aspectj.lang.annotation.DataScope;
import com.car.loan.project.xr.mapper.ReportMapper;
import com.car.loan.project.xr.util.bo.business.report.AuditInfoBo;
import com.car.loan.project.xr.util.bo.business.report.BusinessStatisticsBo;
import com.car.loan.project.xr.util.bo.business.report.ContractAgingBo;
import com.car.loan.project.xr.util.bo.business.report.ContractInfoBo;
import com.car.loan.project.xr.util.bo.business.report.LicenseAgingBo;
import com.car.loan.project.xr.util.bo.business.report.PaymentInfoBo;
import com.car.loan.project.xr.util.bo.business.report.RepaymentInfoBo;
import com.car.loan.project.xr.util.bo.business.report.SettleInfoBo;
import com.car.loan.project.xr.util.vo.report.AuditInfoVo;
import com.car.loan.project.xr.util.vo.report.BusinessStatisticsAmountVo;
import com.car.loan.project.xr.util.vo.report.BusinessStatisticsVo;
import com.car.loan.project.xr.util.vo.report.ContractAgingVo;
import com.car.loan.project.xr.util.vo.report.ContractInfoVo;
import com.car.loan.project.xr.util.vo.report.LicenseAgingVo;
import com.car.loan.project.xr.util.vo.report.PaymentInfoVo;
import com.car.loan.project.xr.util.vo.report.RepaymentInfoVo;
import com.car.loan.project.xr.util.vo.report.SettleInfoVo;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author huangding
 * @date 2020/2/19 13:29
 */
@Service
public class ReportService {

    @Resource
    private ReportMapper reportMapper;

    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<BusinessStatisticsVo> businessStatisticsPage(
        BusinessStatisticsBo businessStatisticsBo) {
        Page page = new Page(businessStatisticsBo.getPageNum(), businessStatisticsBo.getPageSize());
        return reportMapper.selectBusinessStatistics(page, businessStatisticsBo);
    }

    @DataScope(deptAlias = "d", userAlias = "u")
    public BusinessStatisticsAmountVo businessStatisticsAmount(
        BusinessStatisticsBo businessStatisticsBo) {
        return reportMapper.selectBusinessStatisticsAmount(businessStatisticsBo);
    }

    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<AuditInfoVo> getAuditInfoVoPage(
        AuditInfoBo auditInfoBo) {
        Page page = new Page(auditInfoBo.getPageNum(), auditInfoBo.getPageSize());
        return reportMapper.selectAuditInfoVoPage(page, auditInfoBo);
    }


    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<ContractAgingVo> getContractAgingVoPage(
        ContractAgingBo contractAgingBo) {
        Page page = new Page(contractAgingBo.getPageNum(), contractAgingBo.getPageSize());
        return reportMapper.selectContractAgingVoPage(page, contractAgingBo);
    }

    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<ContractInfoVo> getContractInfoVoPage(
        ContractInfoBo contractInfoBo) {
        Page page = new Page(contractInfoBo.getPageNum(), contractInfoBo.getPageSize());
        return reportMapper.selectContractInfoVoPage(page, contractInfoBo);
    }

    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<LicenseAgingVo> getLicenseAgingVoPage(
        LicenseAgingBo licenseAgingBo) {
        Page page = new Page(licenseAgingBo.getPageNum(), licenseAgingBo.getPageSize());
        return reportMapper.selectLicenseAgingVoPage(page, licenseAgingBo);
    }

    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<PaymentInfoVo> getPaymentInfoVoPage(
        PaymentInfoBo paymentInfoBo) {
        Page page = new Page(paymentInfoBo.getPageNum(), paymentInfoBo.getPageSize());
        return reportMapper.selectPaymentInfoVoPage(page, paymentInfoBo);
    }


    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<SettleInfoVo> getSettleInfoVoPage(
        SettleInfoBo settleInfoBo) {
        Page page = new Page(settleInfoBo.getPageNum(), settleInfoBo.getPageSize());
        return reportMapper.selectSettleInfoVoPage(page, settleInfoBo);
    }

    @DataScope(deptAlias = "d", userAlias = "u")
    public Page<RepaymentInfoVo> getRepaymentInfoVoPage(RepaymentInfoBo repaymentInfoBo) {
        Page page = new Page(repaymentInfoBo.getPageNum(), repaymentInfoBo.getPageSize());
        return reportMapper.selectRepaymentInfoVoPage(page, repaymentInfoBo);

    }


}
